package com.my.springboot;

import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Controller;

/**
 * @Project Name:my-springboot
 * @Package Name:com.my.springboot
 * @File Name:ExpenseApplicationDataService
 * @Description:TODO
 * @Author:lxk
 * @Version:2.0
 * @Company: 北京中税汇金智能科技有限公司
 * @Copyright: Copyright(c) 2019, 中税汇金 All Rights Reserved.
 * @date:2023-04-19 16:25
 */
@Component
@EnableAsync
public class ExpenseApplicationDataService {
    @Async
    public void syncData() throws InterruptedException {
        System.out.println("异步方法执行开始......" + Thread.currentThread().getId());
        Thread.sleep(3000);
        System.out.println("异步方法执行结束......" + Thread.currentThread().getId());
    }
}
